package com.originskyseed.platform.course.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.originskyseed.platform.course.model.Course;
import com.originskyseed.platform.course.model.TaskSelectCourseVO;

/**
 * 课程表Mapper类（OSI_COURSE）
 *
 * @author Tangwanghui
 */
public interface CourseMapper {

	/**
	 * 删除记录
	 *
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int deleteByPrimaryKey(String id) throws Exception;

	/**
	 * 批量删除记录
	 *
	 * @param ids
	 * @return
	 * @throws Exception
	 */
	public int deleteByPrimaryKeys(List<String> ids) throws Exception;

	/**
	 * 批量逻辑删除记录
	 *
	 * @param ids
	 * @return
	 * @throws Exception
	 */
	public int updateDelByIds(List<String> ids) throws Exception;

	/**
	 * 批量修改状态
	 * 
	 * @param map
	 * @return
	 * @throws Exception
	 */
	public int updateStatusByIds(Map<String, Object> map) throws Exception;

	/**
	 * 插入记录
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int insert(Course record) throws Exception;

	/**
	 * 插入记录（仅非空值字段）
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int insertSelective(Course record) throws Exception;

	/**
	 * 更新记录
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int updateByPrimaryKey(Course record) throws Exception;

	/**
	 * 更新记录（仅非空值字段）
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int updateByPrimaryKeySelective(Course record) throws Exception;

	/**
	 * 查询记录
	 *
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public Course selectByPrimaryKey(String id) throws Exception;

	/**
	 * 查询列表
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public List<Course> selectList(Course record) throws Exception;

	/**
	 * 分页查询列表
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public List<Course> selectListByPage(Map<String, Object> params) throws Exception;

	/**
	 * 分页查询列表
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public List<Course> selectListRelStudyByPage(Map<String, Object> params) throws Exception;

	/**
	 * 查询课程id是否存在
	 *
	 * @param courseId
	 * @return
	 * @throws Exception
	 */
	public String selectCourseId(@Param("courseId") String courseId) throws Exception;

	/**
	 * 查询最大优先级
	 * 
	 * @return
	 * @throws Exception
	 */
	public Integer selectPrority() throws Exception;

	/**
	 * 更新置顶记录
	 *
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int updateIsTop(Course record) throws Exception;

	/**
	 * 根据优先级查询课程
	 * 
	 * @return
	 * @throws Exception
	 */
	public Course selectCourseByPrority(@Param("prority") Integer prority) throws Exception;

	/**
	 * 分页查询用户课程列表
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public List<Course> selectUserStudySituationList(Map<String, Object> params) throws Exception;

	/**
	 * 分页查询用户课程列表
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public List<Course> selectUserCourseByPage(Map<String, Object> params) throws Exception;

	/**
	 * 根据优先级查询状态
	 * 
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public Integer selectStatusByPrority(Map<String, Object> params) throws Exception;

	/**
	 * 任务发布课程选择列表
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public List<TaskSelectCourseVO> selectTaskCourseByPage(Map<String, Object> params) throws Exception;

	/**
	 * 查询课程分类是否存在
	 * 
	 * @param courseTypeId
	 * @return
	 * @throws Exception
	 */
	public String selectCourseTypeExist(@Param("courseTypeId") String courseTypeId) throws Exception;
}
